package net.towee.client.event.core;

import net.towee.model.account.Board;
import net.towee.model.account.Gadget;

import com.google.gwt.event.shared.GwtEvent;

public class GadgetAttached extends GwtEvent<GadgetAttachedHandler> {
	public static final Type<GadgetAttachedHandler> TYPE = new Type<GadgetAttachedHandler>();
	
	private final Board board;
	private final Gadget gadget;
	
	public GadgetAttached(Gadget g, Board b) {
		this.board = b;
		this.gadget = g;
	}
	
	@Override
	public Type<GadgetAttachedHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(GadgetAttachedHandler handler) {
		handler.onGadgetAttached(gadget, board);
	}

}
